<link rel="stylesheet" href="../../css/shoppingcart.css">

<% Date.prototype.Format = function (fmt) { //author: meizz
    var o = {
        "M+": this.getMonth() + 1,                 //月份
        "d+": this.getDate(),                    //日
        "h+": this.getHours(),                   //小时
        "m+": this.getMinutes(),                 //分
        "s+": this.getSeconds(),                 //秒
        "q+": Math.floor((this.getMonth() + 3) / 3), //季度
        "S": this.getMilliseconds()             //毫秒
    };
    if (/(y+)/.test(fmt))
        fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
    for (var k in o)
        if (new RegExp("(" + k + ")").test(fmt))
            fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    return fmt;
}
%>
<div class="body">
    <%for(var i=0;i<data.length;i++){%>

    <%if (data[i].type=='游玩'){%>
    <ul>
        <li>
            <div class="left">
                <div class="choose check" id="<%= data[i].id%>" onclick="CART.calc('<%= data[i].id%>')">
                    <img class="img" style="display: none" src="images/select.png" width="70%">
                </div>
            </div>
            <div class="right">
                <div class="goods-img">
                    <img class="goodsimg" src="<%=data[i].goodimg%>" width="100%">
                </div>
                <div class="goods-desc">
                    <p class="desc-name"><%=data[i].name%></p>
                    <p class="desc-type">
                        <span  class="type"></span><span><%=new Date(data[i].starttime).Format('MM.dd')%>-<%=new Date(data[i].endtime).Format('MM.dd')%></span>
                    </p>
                    <p class="price">
                    <p class="price-desc"><span>￥</span><span id="unit"><%=data[i].price%></span>
                    </p>
                    <p class="num-desc"><span>x</span><span id="quantity"><%=data[i].count%></span></p>
                    </p>
                </div>
            </div>
        </li>
    </ul>
    <%}%>
    <%if (data[i].type=='会议'){%>
    <ul>
        <li>
            <div class="left">
                <div class="choose check" id="<%= data[i].id%>" onclick="CART.calc('<%= data[i].id%>')">
                    <img class="img" style="display: none" src="images/select.png" width="70%">
                </div>
            </div>
            <div class="right">
                <div class="goods-img">
                    <img class="goodsimg" src="<%=data[i].goodimg%>" width="100%">
                </div>
                <div class="goods-desc">
                    <p class="desc-name"><%=data[i].name%></p>
                    <p class="desc-type">
                        <span  class="type"></span><span><%=new Date(data[i].starttime).Format('MM.dd')%>-<%=new Date(data[i].endtime).Format('MM.dd')%> </span>
                    </p>
                    <p class="price">
                    <p class="price-desc"><span>￥</span><span id="unit"><%=data[i].price%></span>
                    </p>
                    <p class="num-desc">x<span><span id="quantity"><%=data[i].count%></span></span></p>
                    </p>
                </div>
            </div>
        </li>
    </ul>
    <%}%>
    <%if (data[i].type=='餐饮'){%>
    <ul>
        <li>
            <div class="left">
                <div class="choose check" id="<%= data[i].id%>" onclick="CART.calc('<%= data[i].id%>')">
                    <img class="img" style="display: none" src="images/select.png"   width="70%">
                </div>
            </div>
            <div class="right">
                <div class="goods-img">
                    <img class="goodsimg" src="<%=data[i].goodimg%>" width="100%">
                </div>
                <div class="goods-desc">
                    <p class="desc-name"><%=data[i].name%></p>
                    <p class="desc-type">
                        <span  class="type"><%=new Date(data[i].starttime).Format('MM.dd')%>-<%=new Date(data[i].endtime).Format('MM.dd')%></span>
                    </p>
                    <p class="price">
                    <p class="price-desc"><span>￥</span><span id="unit"><%=data[i].price%></span></p>
                    <p class="num-desc">x<span id="quantity"><%=data[i].count%></span></p>
                    </p>
                </div>
            </div>
        </li>
    </ul>
    <%}%>
    <%if (data[i].type=='住宿'){%>
    <ul>
        <li>
            <div class="left">
                <div class="choose check" id="<%= data[i].id%>" onclick="CART.calc('<%= data[i].id%>')">
                    <img class="img" style="display: none" src="images/select.png" width="70%">
                </div>
            </div>
            <div class="right">
                <div class="goods-img">
                    <img class="goodsimg" src="<%=data[i].goodimg%>" width="100%">
                </div>
                <div class="goods-desc">
                    <p class="desc-name"><%=data[i].name%></p>
                    <p class="desc-type">
                        <span  class="type"><%=new Date(data[i].starttime).Format('MM.dd')%>-<%=new Date(data[i].endtime).Format('MM.dd')%></span>
                    </p>
                    <p class="price">
                    <p class="price-desc"><span>￥</span><span id="unit"><%=data[i].price%></span>
                    </p>
                    <p class="num-desc">x<span><span id="quantity"><%=data[i].count%></span></span></p>
                    </p>
                </div>
            </div>
        </li>
    </ul>
    <%}%>
    <%}%>


    <div class="bottom" style="width: 100%;height: 120px;"></div>



    <div class="balance">
        <div class="choose-area">
            <div class="chooseall check" onclick="CART.chooseall()">
                <img class="allimg" style="display: none" src="images/select.png" width="70%">
            </div>
        </div>
        <div class="amounts">
            <p class="all-font">全选</p>
            <p class="calc"><span>合计:</span><span class="strong">￥</span><span id="amounts" class="strong">0</span>
            </p>
        </div>
        <div class="settle" id="settle" onclick="CART.settlecart()">结算</div>
    </div>
</div>